using System;
using System.IO;

namespace BankSimulation
{
	public class Account
	{
		public string AccountNumber { get; set; } = string.Empty;
		public string Owner { get; set; } = string.Empty;
		public decimal Balance { get; protected set; }

		public Account(string accountNumber, string owner, decimal initialBalance)
		{
			AccountNumber = accountNumber;
			Owner = owner;
			Balance = initialBalance;
		}

		public virtual void Deposit(decimal amount)
		{
			Balance += amount;
		}

		public virtual void Withdraw(decimal amount)
		{
			if (amount > Balance)
				throw new InvalidOperationException("余额不足");
			Balance -= amount;
		}

		private Stream _stream = null!;
	}
}